<?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
<div class="page-head">
    <h3><?php echo $this->__('Business Login Download') ?></h3>
</div>
<div class="padder">

<?php 
if(Mage::getSingleton('customer/session')->getCustomerGroupId()=='4'):
$out_html=array();	
$posts = $this->getPosts(); 
$cat_old='-1';
$cat_new='1';
$title_new='';
?>
<?php foreach ($posts as $post): ?>

<?php foreach($post->getCats() as $title=>$url){ 
	$cat_new=$url;
	$title_new=$title;
 } ?>
<?php 
if($cat_new!=$cat_old){
	$cat_old=$cat_new;
	$out_html[$title_new].= '<div class="head-alt2">';
	echo '<h5 class="title">';
	echo $title_new;
	echo '</h5>';
	echo '</div>';
}
?>
<h2><a href="<?php echo str_ireplace('index.php/','',$this->getUrl()) .'media'. $post->getBsfile(); ?>" >
<?php 
if($title_new=='Image File'){
	echo '<img src="'.str_ireplace('index.php/','',$this->getUrl()) .'media'. $post->getBsfile().'" border="0" width="200"/>';
}else{
	echo $post->getTitle();
}
?>
</a></h2>
<?php endforeach; ?>
<?php else:?>
<h2>You don't have the priority to view this page.</h2>
<?php endif;?>
</div>